#include <stdio.h>
#include <stdlib.h>
#include "hash.h"

int main(void)
{
        HashTable ht;
        datatype ar[] = {19, 14, 23, 1, 68, 20, 84, 27, 55, 11, 10, 79};
        int n = sizeof(ar)/sizeof(datatype);

        InitHashTable(ht);
        for (int i = 0; i < n; i++)
                InsertHashTable(ht, ar + i);
        ShowHashTable(ht);

        int sea = 27;
        HashNode *ptr = SearchHashTable(ht, &sea);
        if (ptr != NULL)
                printf("找到：%d\n", ptr->data);
        else
                printf("未找到!\n");

        int ret = RemoveHashTable(ht, &sea);
        if (ret < 0)
                printf("要删除的结点不存在\n");
        else
                printf("值为%d的结点已删除\n", sea);
        ShowHashTable(ht);

        exit(EXIT_SUCCESS);
}
